package ltd.hxya.novel.book.controller;

import io.swagger.v3.oas.annotations.Operation;
import ltd.hxya.novel.book.dto.ImgVerifyCodeRespDto;
import ltd.hxya.novel.book.service.UserInfoService;
import ltd.hxya.novel.book.utils.resp.RestResp;
import ltd.hxya.novel.common.bean.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author ZWW
 */
@RestController
@RequestMapping("/book/user")
public class UserController {
    @Autowired
    private UserInfoService userInfoService;


    /**
     * 获取图片验证码接口
     * 把图片存在了redis中，并且设置了时间
     * @return
     * @throws IOException
     */
    @Operation(summary = "获取图片验证码接口")
    @GetMapping("img_verify_code")
    public Result<ImgVerifyCodeRespDto> getImgVerifyCode() throws IOException {
        return userInfoService.getImgVerifyCode();
    }


}
